import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraPatrolTaskExcuterVO, cameraPatrolTaskExcuterQuery } from '@/api/security/video-patrol/camera-patrol-task-executer/types';

/**
 * 查询巡视任务执行人列表
 * @param query
 * @returns {*}
 */

export const listcameraPatrolTaskExcuter = (query?: cameraPatrolTaskExcuterQuery): AxiosPromise<cameraPatrolTaskExcuterVO[]> => {
  return request({
    url: '/camera/patrolTaskExecutor/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询巡视任务执行人详细
 * @param cameraPatrolTaskId
 */
export const getcameraPatrolTaskExcuter = (cameraPatrolTaskExecutorId: string | number): AxiosPromise<cameraPatrolTaskExcuterVO> => {
  return request({
    url: '/camera/patrolTaskExecutor/' + cameraPatrolTaskExecutorId,
    method: 'get'
  });
};
/**
 * 查询巡检路线
 */
export const getCameraList = (cameraPatrolTaskExecutorId: string | number) => {
  return request({
    url: '/camera/patrolTaskExecutor/get-patrol-route/' + cameraPatrolTaskExecutorId,
    method: 'get'
  });
};
export const patrolTaskInfoLogStart = (patrolTaskId: string | number) => {
  return request({
    url: '/camera/patrolTaskInfoLog/start/' + patrolTaskId,
    method: 'get'
  });
};
// 修改巡视任务-人员任务

export const updatePatrolTaskExecutor = (data: cameraPatrolTaskExcuterQuery) => {
  return request({
    url: '/camera/patrolTaskExecutor',
    method: 'put',
    data: data
  });
};
export const updatePatrolTaskExecutorClock = (data:any) => {
  return request({
    url: '/camera/patrolTaskExecutor/editClock',
    method: 'post',
    data: data
  });
};

export const implement = (cameraPatrolTaskExecutorId: string | number) => {
  return request({
    url: '/camera/patrolTaskExecutor/implement/' + cameraPatrolTaskExecutorId,
    method: 'get'
  });
};
